package com.edu.juc.interrupt;

/**
 * Thread.interrupted():
 * 测试当前线程是否被中断（检查中断标志），返回一个boolean并清除中断状态，
 * 第二次再调用时中断状态已被清清除，将返回一个false
 */
public class InterruptedTest {
    public static void main(String[] args) {
        System.out.println(Thread.interrupted());
        System.out.println(Thread.interrupted());
        Thread.currentThread().interrupt();
        System.out.println(Thread.interrupted());
        System.out.println(Thread.interrupted());
    }
}
